<template>
  <a-modal
    :visible="visible"
    title="批量审核"
    :width="700"
    :confirmLoading="confirmLoading"
    @cancel="() => { $emit('cancel') }"
    @ok="submit"
  >
    <a-form :form="form" style="margin-top: 10px">
      <a-row>
        <a-col :md="8" :sm="24">
          <a-form-item
            label="审核结果"
            :labelCol="{span: 8,offset: 1}"
            :wrapperCol="{span: 14, offset: 1}"
          >
            <a-select v-decorator="['shzt',
              {
                rules: [{ required: true, message: '请选择审核结果!' }],
              }]">
              <a-select-option value="03">通过</a-select-option>
              <a-select-option value="04">不通过</a-select-option>
              <!-- <a-select-option v-for="i in TYPE0338" :key="i.id" :value="i.code">{{ i.name }}</a-select-option> -->
            </a-select>
          </a-form-item>
        </a-col>
        <a-col :md="16" :sm="24">
          <a-form-item
            label="审核意见"
            :labelCol="{span: 7,offset: 1}"
            :wrapperCol="{span: 15, offset: 1}"
          >
            <a-input type="textarea" v-decorator="['shsm']" :autosize="{ minRows: 4, maxRows: 6 }"/>
          </a-form-item>
        </a-col>
      </a-row>
    </a-form>
  </a-modal>
</template>

<script>


export default {
  props: {
    visible: Boolean,
    ids: Array,
    confirmLoading: Boolean
  },
  beforeCreate () {
    this.form = this.$form.createForm(this)
  },
  methods: {
    submit(){
      this.form.validateFields((err, values) => {
        if (err) {
          return
        }
        this.$api.cultivate.courseCheck({ids: this.ids.join(','), shzt: values.shzt, shsm: values.shsm}).then(() => {
          this.$message.success('审核成功')
          this.$emit('cancel')
          this.$emit('doRefresh')
        })
      })
    }
  }
}
</script>

<style>

</style>
